<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>performance test</title>
	<meta name="viewport"
		content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
	<link rel="stylesheet" href="001.css">	
	<script src="https://cdn.bootcss.com/jquery/1.12.0/jquery.min.js"></script>
	<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	<script src="../src/web-report-default.js"></script>
	<script>
		Performance({
			domain: 'http://127.0.0.1:7001/api/v1/report/web',
			add: {
				appId: 'DSHdcTA1548207437671'
			},
		})

		Performance.addData((data) => {
			data.name = 'wangwei'
			data.some = {
				name: 'wangwie',
				age: 20
			}
		})
	</script>
</head>

<body>
	<div>performance test</div>
	<div>
		<ul>
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
		<h1>标题H1</h1>
		<h2>标题H2</h2>
		<h3>标题H3</h3>
		<h4>标题H4</h4>
		<h5>标题H5</h5>
		<h6>标题H6</h6>
		<div class="clice"><button id="button1">同步点击错误上报按钮</button></div>
		<div class="clice" style="margin-top:20px;"><button id="button2">异步点击错误上报按钮</button></div>
		<div class="clice" style="margin-top:20px;"><button id="button3">点击按钮Ajax性能上报按钮</button></div>
		<!-- <img src="http://img1.imgtn.bd95510">
		<img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=295864288,1887240069&fm=27&gp=0.jpg" id="img1"> -->
	</div>
	<script>
		$('#button1').click(()=>{
			console.log(zane)
		})
		$('#button2').click(() => {
			Promise.resolve().then(() => {
				console.log(zane000)
			})
		})
		$('#button3').click(()=>{
			$.ajax({
				type: 'post',
				url: 'http://mock-api.seosiwei.com/guest/order/api/order/getOrder',
				success: data => {
					console.log('------')
				}
			})
			$.ajax({
				type:'get',
				report:'report-data',
				url:'http://mock-api.seosiwei.com/guest/home/api/shop/getHomeInitInfo',
				success:data=>{
					// console.log(data)
				}
			})
		})
		// axios({
		// 	  method: 'post',
		// 	  url: 'http://mock-api.seosiwei.com/guest/order/api/order/getOrde1',
		// }).then(function(response) {
		// 	console.log(response)
		// });
		// axios.request({
		// 	method: 'post',
		// 	url: 'http://mock-api.seosiwei.com/guest/order/api/order/getOrde2',
		// }).then(function (response) {
		// 	console.log(response)
		// });

		// axios.get('/user?ID=12345')
		//   .then(function (response) {
		//     console.log(response);
		//   })
		//   .catch(function (error) {
		//     console.log(error);
		//   });

		// $.ajax({
		// 	type:'get',
		// 	report:'report-data',
		// 	url:'http://mock-api.seosiwei.com/guest/home/api/shop/getHomeInitInf',
		// 	success:data=>{
		// 		// console.log(data)
		// 	}
		// })

		$.ajax({
			type: 'post',
			url: 'http://mock-api.seosiwei.com/guest/order/api/order/getOrder?time=123456',
			success: data => {
				console.log('------')
			}
		})

		// $.ajax({
		// 	type:'post',
		// 	url:'http://mock-api.seosiwei.com/guest/order/api/order/getOrde',
		// 	success:data=>{
		// 		// console.log(data)
		// 	}
		// })

		fetch('http://mock-api.seosiwei.com/guest/order/api/order/getOrder', {
			method: 'POST',
		}).then(function (response) {
			console.log('++++')
		})

		// var req = new Request('http://mock-api.seosiwei.com/guest/home/api/shop/getHomeInitInfo', { method: 'GET', cache: 'reload' });
		// fetch(req).then(function (response) {
		// 	console.log('-----')
		// 	console.log(response)
		// })

        // console.log(wangwei)
        
        const somePromise = new Promise(_ => {
            let a
            a.doingNothing
        })
        somePromise.then(console.log)

    </script>
    <script src="./test.js"></script>
</body>

</html>